﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace Questionary.Model
{
    public class QuestionItem
    {
		public QuestionItem()
		{
			ID = -1;
		}

        /// <summary>
        /// 问题序号
        /// </summary>
        public int ID { get; set; }
        /// <summary>
        /// 问题内容
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 备注内容
        /// </summary>
        public string Remark { get; set; }

		/// <summary>
		/// 0-单选，1-多选，2-客观题
		/// </summary>
		public int QType { get; set; }

		/// <summary>
		/// 提供选项
		/// </summary>
		public List<SelectionItem> Selections
        {
            get { return _selections; }
            set { _selections = value; }
        }
        private List<SelectionItem> _selections = new List<SelectionItem>();

        public string GetSelectionText()
        {
            StringBuilder sb = new StringBuilder();

            foreach (var sItem in Selections)
            {
                sb.Append(sItem.Content);
                sb.Append("&nbsp;&nbsp;");
            }

            return sb.ToString();
        }
    }
}